package com.gilight.base.mapper;

import com.gilight.base.dto.order.OrderDTO;
import com.gilight.base.model.KVModel;
import com.gilight.base.model.order.OrderDO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * Created by rize on 2019/7/6.
 */
@Repository
public interface OrderMapper extends IMapper<OrderDO> {

    public List<OrderDTO> selectOrderPage(@Param("status") Integer status, @Param("offset") Integer offset, @Param("limit") Integer limit, @Param("userId") Long userId,@Param("zzjgIds") List<Long> zzjgIds);

    public List<OrderDTO> selectOrderPageByStatus(@Param("status") List<Integer> status, @Param("offset") Integer offset, @Param("limit") Integer limit, @Param("userId") Long userId,@Param("zzjgIds") List<Long> zzjgIds);

    public Long countOrder(@Param("status") Integer status, @Param("offset") Integer offset, @Param("limit") Integer limit, @Param("userId") Long userId,@Param("zzjgIds") List<Long> zzjgIds);

    public List<Map<String,Object>> countOrderInCook(@Param("zzjgid") Long zzjgid);

    public Long countOrderByStatus(@Param("status") List<Integer>  status, @Param("offset") Integer offset, @Param("limit") Integer limit, @Param("userId") Long userId,@Param("zzjgIds") List<Long> zzjgIds);
    /**
     * 获取订单地区统计
     * @return
     */
    public List<KVModel<String, Long>> selectAreaStatistics(@Param("zzjgIds") List<Long> zzjgIds);

    public List<KVModel<String, Long>> selectChannelStatistics(@Param("zzjgIds") List<Long> zzjgIds);

    public List<KVModel<String, Long>> selectOrderCountStatistics(String gmtStart,@Param("zzjgIds") List<Long> zzjgIds);

    public List<KVModel<String, Long>> selectOrderSumStatistics(String gmtStart,@Param("zzjgIds") List<Long> zzjgIds);

    public List<OrderDO> selectExpireOrderNos(@Param("status") Integer status, @Param("time") Date time,@Param("zzjgIds") List<Long> zzjgIds);

}
